﻿<%@ Page Language="C#" MasterPageFile="~/MainMaster.Master" AutoEventWireup="true"
    CodeBehind="BoardItems.aspx.cs" Inherits="Mang24k99.Web.PUBC.BoardItems" Title="调查表条目维护" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript">
        function TextClear(oEvent,defultText)
        {  
            //如果当前值为默认值，则清空 
            var obj=oEvent.srcElement ? oEvent.srcElement : oEvent.target;
            with(obj) 
            if(value==defultText) value="" 
        }
        function TextRes(oEvent,defultText)
        { 
             //如果值为空，则赋默认值
            var obj=oEvent.srcElement ? oEvent.srcElement : oEvent.target;
            with(obj) 
            if(value=="") value=defultText 
        }
        function verify(obj)
        {
          if(!(obj.keyCode>=48 && obj.keyCode<=57))
          {
              obj.returnValue = false;
          } 
        }
    </script>
    <asp:Panel ID="Panel1" runat="server">
        <asp:Button ID="btnAdd" runat="server" CssClass="form_btn" Text="新增条目" OnClick="btnAdd_Click" />
    </asp:Panel>
    <table>
        <tr>
            <td class="tb_title1">
                所属调查表
            </td>
            <td class="tb_txt1">
                <asp:DropDownList ID="ddlBoardType" runat="server" AutoPostBack="true" 
                    onselectedindexchanged="ddlBoardType_SelectedIndexChanged">
                </asp:DropDownList>
            </td>
            <td class="tb_title1">
                周期
            </td>
            <td class="tb_txt1">
                <asp:DropDownList ID="ddlBoardCyc" runat="server" AutoPostBack="true" 
                    onselectedindexchanged="ddlBoardCyc_SelectedIndexChanged">
                </asp:DropDownList>
            </td>
        </tr>
    </table>
    <asp:Panel ID="Panel2" runat="server">
        <asp:Button ID="btnBack" runat="server"  CssClass="form_btn" Text="返回列表" 
            onclick="btnBack_Click" />
        <table width="100%">
            <tr>
                <td class="tb_title1" width="20%">
                    条目显示名称：
                </td>
                <td class="tb_txt1">
                    <asp:TextBox ID="txtItemName" runat="server" MaxLength="60" Width="90%"></asp:TextBox>
                    <asp:TextBox ID="txtItemNO" runat="server" CssClass="hidden"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="tb_title1">
                    简称：
                </td>
                <td class="tb_txt1">
                    <asp:TextBox ID="txtItemAlias" runat="server" MaxLength="15" Width="50%"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="tb_title1">
                    权重：
                </td>
                <td class="tb_txt1">
                    <asp:TextBox ID="txtPowerRtio" runat="server" MaxLength="4" onkeypress="verify(event)"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td colspan="2" align="center">
                    <asp:Button ID="btnSave" CssClass="form_btn" runat="server" Text="新增" OnClick="btnSave_Click" />
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <asp:Button ID="btnCancel" CssClass="form_btn" runat="server" Text="取消" 
                       OnClientClick="return confirm('未保存的操作将丢失，确定取消吗')" OnClick="btnCancel_Click" />
                </td>
            </tr>
        </table>
    </asp:Panel>
    <asp:Panel ID="Panel3" runat="server">
        <div>
            <asp:GridView ID="grdList" runat="server" AutoGenerateColumns="False" 
                     onrowcommand="grdList_RowCommand" Width="100%">
                <HeaderStyle CssClass="tb_title2" />
                <RowStyle CssClass="tb_txt2" />
                <Columns>
                    <asp:TemplateField HeaderText="序号">
                        <ItemTemplate>
                            <%#Container.DataItemIndex+1%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="ItemNO" HeaderText="条目编号" />
                    <asp:BoundField DataField="ItemName" HeaderText="条目显示名称" />
                    <asp:BoundField DataField="ItemAlias" HeaderText="条目简称" />
                    <asp:BoundField DataField="PowerRtio" HeaderText="权重" />
                    <asp:TemplateField HeaderText="编辑">
                        <ItemTemplate>
                            <asp:LinkButton ID="lkbtnEdit" runat="server" CommandName="Modi" CommandArgument='<%# Eval("ItemNO")%>'>编辑
                            </asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="删除">
                        <ItemTemplate>
                            <asp:LinkButton ID="lkbtnDel" runat="server" CommandName="Del" CommandArgument='<%# Eval("ItemNO")%>'
                                    OnClientClick="return confirm('确定要删除该条目吗？')">删除
                            </asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </div>
    </asp:Panel>
</asp:Content>
